// 引入vue
import Vue from "vue";
// 引入App
import App from "./App.vue";
// 引入router
import VueRouter from "vue-router";
// 引入router子组件
import HomeView from "./views/HomeView.vue";
import SecondView from "./views/SecondView.vue";
// 注册router
Vue.use(VueRouter);
// 设置路由规则
const routes = [
  {
    path: "/",
    component: HomeView,
  },
  {
    path: "/about",
    component: SecondView,
  },
];
// 写一些全局的配置
Vue.config.productionTip = false;
// 实例化touter
const router = new VueRouter({
  routes,
});
// 实例化vue
new Vue({
  // 配置选项
  router,
  render: (h) => h(App),
}).$mount("#app");
